package models.outstock

import java.sql.Timestamp
import java.time.LocalDateTime

/**
 *
 * @param osrid
 * @param osrOutStockSumId
 * @param osrFEntity
 * @param osrFDate    单据日期/发货日期
 * @param osrFGYBillNo   单据编号 "SDO128041097656",
 * @param osrFShopNumber  店铺代码# "C030037",
 * @param osrFStockNumber 仓库代码 # "SCM02",
 * @param osrSumStatus   汇总状态（0：未汇总，1：准备汇总，2：完成汇总）
 * @param osrFEntityInfo 明细信息
 */
case class OutStockRecive(osrid: Option[Int] = None,
                          osrOutStockSumId: Option[Int] = None,
                          osrFEntity: Boolean = true,
                          osrFDate: Timestamp = Timestamp.valueOf(LocalDateTime.now),
                          osrFGYBillNo: String ="",
                          osrFShopNumber: String="",
                          osrFStockNumber:String="",
                          osrSumStatus: Int = 0,
                          osrFEntityInfo:Option[String] = None,
                         )
object OutStockRev {
  //implicit val osrOutStockReciveFormat = Json.format[OutStockRecive]
  val strSumStatus = ( x:OutStockRecive)=>x.osrSumStatus match {
    case 0 => "未汇总";
    case 2 => "完成汇总";
    case i if i<0 => "准备汇总";
    case _ => s"未定义:${x.osrSumStatus}";
  }
}
